package com.example.makerspace.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.CompanyDO;
import com.example.makerspace.mapper.CompanyMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class CompanyDAO extends BaseDAO<CompanyDO>{
    @Resource
    private CompanyMapper companyMapper;
    @PostConstruct
    public void init(){
        this.mapper = companyMapper;
    }
    public final static String COMPANY_NAME = "company_name";
    public final static String CATEGORY = "category";
    public final static String KEYWORD = "keyword";
    public final static String COMPANY_DESC = "company_desc";

    public CompanyDO selectByCompanyName(String companyName){
        return companyMapper.selectOne(new QueryWrapper<CompanyDO>().eq(COMPANY_NAME, companyName));
    }

}
